home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / tcclib.exe / GETYN.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-02-07  |  560 b   |  26 lines

  1. #include <string.h>
  2. #include <conio.h>
  3. #include "tcclib.h"
  4. #include <ctype.h>
  5.  
  6. int GetYN (char *s)
  7. {
  8.     char Scr[800];
  9.     int p, x, xx, ch;
  10.  
  11.     p = ( 80 - strlen( s ) ) / 2;
  12.     x = p - 3;
  13.     xx = p + strlen( s ) + 2;
  14.     if ( x  <  1 ) x  = 1;
  15.     if ( xx > 80 ) xx = 80;
  16.     gettext( x, 8, xx, 12, Scr );
  17.     ExplodeBox( x, 8, xx, 12 );
  18.     AtSay( p, 10, s );
  19.     ChangeBlock( x, 8, xx, 12, A_REVERSE );
  20.     ch = GComm();
  21.     puttext( x, 8, xx, 12, Scr );
  22.     if ( toupper( ch ) == 'Y' )
  23.         return( 1 );
  24.     return( 0 );
  25. }
  26.